//
//  UIView+AYYAdd.m
//  WayService
//
//  Created by bingo on 2017/10/30.
//  Copyright © 2017年 Knoworth. All rights reserved.
//

#import "UIView+AYYAdd.h"

@implementation UIView (AYYAdd)

- (CGFloat)ayy_left {
    return self.frame.origin.x;
}

- (void)setAyy_left:(CGFloat)x {
    CGRect frame = self.frame;
    frame.origin.x = x;
    self.frame = frame;
}

- (CGFloat)ayy_top {
    return self.frame.origin.y;
}

- (void)setAyy_top:(CGFloat)y {
    CGRect frame = self.frame;
    frame.origin.y = y;
    self.frame = frame;
}

- (CGFloat)ayy_right {
    return self.frame.origin.x + self.frame.size.width;
}

- (void)setAyy_right:(CGFloat)right {
    CGRect frame = self.frame;
    frame.origin.x = right - frame.size.width;
    self.frame = frame;
}

- (CGFloat)ayy_bottom {
    return self.frame.origin.y + self.frame.size.height;
}

- (void)setAyy_bottom:(CGFloat)bottom {
    CGRect frame = self.frame;
    frame.origin.y = bottom - frame.size.height;
    self.frame = frame;
}

- (CGFloat)ayy_width {
    return self.frame.size.width;
}

- (void)setAyy_width:(CGFloat)width {
    CGRect frame = self.frame;
    frame.size.width = width;
    self.frame = frame;
}

- (CGFloat)ayy_height {
    return self.frame.size.height;
}

- (void)setAyy_height:(CGFloat)height {
    CGRect frame = self.frame;
    frame.size.height = height;
    self.frame = frame;
}

- (CGFloat)ayy_centerX {
    return self.center.x;
}

- (void)setAyy_centerX:(CGFloat)ayy_centerX {
    self.center = CGPointMake(ayy_centerX, self.center.y);
}

- (CGFloat)ayy_centerY {
    return self.center.y;
}

- (void)setAyy_centerY:(CGFloat)centerY {
    self.center = CGPointMake(self.center.x, centerY);
}

- (CGPoint)ayy_center {
    return self.center;
}

- (void)setAyy_center:(CGPoint)center {
    self.center = center;
}

- (CGPoint)ayy_origin {
    return self.frame.origin;
}

- (void)setAyy_origin:(CGPoint)origin {
    CGRect frame = self.frame;
    frame.origin = origin;
    self.frame = frame;
}

- (CGSize)ayy_size {
    return self.frame.size;
}

- (void)setAyy_size:(CGSize)size {
    CGRect frame = self.frame;
    frame.size = size;
    self.frame = frame;
}

@end
